import java.util.Arrays;
import java.util.Scanner;

public class DisappearTest {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int [] num1 =new int [n+1]; //0~n的数字
        int [] num2 =new int[n-1];  //缺少一个的数组
        int [] num3 =new int[n+1];  // 用来异或数组
        for (int i = 0; i <=n ; i++) {
            num1[i] = i;
        }
        for (int j = 0; j < n; j++) {

            num2[j] = sc.nextInt();
        }
        for (int h = 0; h < n; h++) {
num3[h] = num2[h]^num1[h];
        }
        num3[n]^=num1[n];
        for (int i = 0; i <=n; i++) {
            if(num3[i]!=0){
                System.out.println(num3[i]);
            }
        }
        System.out.println(0);
    }
}
